package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class JDBCDemo3 {
    public static void main(String[] args) throws Exception {
        Connection connection = DEUtil.getConnection();
        System.out.println("与数据库建立链接");
        Statement statement = connection.createStatement();
        String sql = "UPDATE user SET password='666666',nickname='阿四',age=33 WHERE id=1";
        int num = statement.executeUpdate(sql);
        if(num>0){
            System.out.println("更新成功");
        }else{
            System.out.println("更新失败");
        }
        connection.close();
    }
}
